package com.spddr.pmos.jpa;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class RolePermissionId implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	private long role;
	private int permisssion;

	public RolePermissionId() {
	}

	public RolePermissionId(long role, int permisssion) {
		this.role = role;
		this.permisssion = permisssion;
	}

	@Column(name = "role", nullable = false)
	public long getRole() {
		return this.role;
	}

	public void setRole(long role) {
		this.role = role;
	}

	@Column(name = "permisssion", nullable = false)
	public int getPermisssion() {
		return this.permisssion;
	}

	public void setPermisssion(int permisssion) {
		this.permisssion = permisssion;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + permisssion;
		result = prime * result + (int) (role ^ (role >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RolePermissionId other = (RolePermissionId) obj;
		if (permisssion != other.permisssion)
			return false;
		if (role != other.role)
			return false;
		return true;
	}
}